<?php
require_once("config.php");
$title = "Whois Checker";
require_once("header.php");
require_once("functions.php");

if (!$allow_url_fopen) {
	echo '<span class="error"><b>Note</b>: Please enable \'<em>allow_url_fopen</em>\' option in PHP configuration file</span><br/>';
}

$domain = @$_REQUEST['domain'];
$content = '';

if (!empty($domain)) {

	list($with_www, $without_domain) = get_domain($domain);
	
	require_once("Request.php");
	
	$req = new Request($without_domain);
	$content = $req->get_whois();
}

?>
<table width="98%" cellpadding="0" cellspacing="0" class="mytable">
  <tr>
    <td valign="top" colspan="2"></td>
  </tr>
  <tr>
    <td valign="top" align="middle" colspan="2">
        <form action="whois.php" method="get" name="pageform">
          <table width="98%" border="0">
            <tbody>
              <tr>
                <td valign="top" width="98%" height="91"><table height="76" width="98%">
                    <tbody>
                      <tr>
                        <td><table cellspacing="5" width="98%" border="0">
                            <tbody>
                              <tr>
                                <td width="184" height="28"><strong>Your domain: </strong></td>
                                <td height="28"><input size="33" value="<?php echo @$without_domain; ?>" name="domain" /></td>
                                <td height="28"><input name="submit" type="submit" value="Check!" class="button" /></td>
                              </tr>
                              <tr>
                                <td height="21">&nbsp;</td>
                                <td valign="top" colspan="2" height="21">(eg.   webpromotioner.com)</td>
                              </tr>
                            </tbody>
                        </table></td>
                      </tr>
                    </tbody>
                </table></td>
              </tr>
            </tbody>
          </table>
        </form>
    </td>
  </tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="bodytext"><?php echo $content; ?></td>
  </tr>
</table>

<?php
require_once("footer.php");
?>